<?php session_start(); ?>
<?php
 if(!$_SESSION['uname']){
  echo '{"Status":0,"ReturnCode":"你没有权限访问此页面!"}';
  return false;
}
?>
<?php include("../inc/db_config.inc"); ?>
<?php

if(isset($_REQUEST['links'])&&$_REQUEST['links']!=""){
    $blog_url=$_REQUEST['links'];
}else{
    echo '{"Status":0,"ReturnCode":"博客地址不能为空!"}';
    return false;
}

//echo "insert into link (url,name,desc,created) values('$link_url','$link_title','$link_desc','$link_created')";
$result_post=mysql_query("select * from blogs where links like '%$blog_url%'");
$num=mysql_num_rows($result_post);
if($num>0){
    echo '{"Status":0,"ReturnCode":"博客地址已存在!"}';
}else{
    echo '{"Status":1,"ReturnCode":"可以添加"}';
}
 ?>